{% extends 'backend/backend_base.html' %}
{% block content %}


    <form action="/add_article/" method="post">
    {% csrf_token %}
        <div>
        <p>添加文章</p>
        <div class="form-group">
            <label for="id_name">文章标题</label>
            <input type="text" name="title" id="id_title" class="form-control">
        </div>
        <p>内容(KindEditor编辑器, 不支持拖放、粘贴上传图片)</p>
        <textarea name="text_content" id="editor_id" cols="130" rows="30">
        </textarea>
        <p>
            <button class="btn btn-success">提交</button>
        </p>
    </div>
    </form>



    <script charset="utf-8" src="/static/kindeditor/kindeditor-all.js"></script>
    <script charset="utf-8" src="/static/kindeditor/lang/zh-CN.js"></script>
    <script>
        KindEditor.ready(function (K) {
            window.editor = K.create('#editor_id', {
                width: '100%',
                height: '400px',
                resizeType: 0,
                uploadJson : '/upload/',
                extraFileUploadParams: {
                    csrfmiddlewaretoken: "{{ csrf_token }}"
                }
            });
        });
    </script>

{% endblock %}





